﻿<UserControl x:Class="BookManager.Views.BookDetailsWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
        MinHeight="300" MinWidth="500" PreviewKeyDown="UserControl_PreviewKeyDown">
    <UserControl.Background>
        <LinearGradientBrush StartPoint="0,0.5" EndPoint="1,0.5">
            <GradientStop Color="#FFDCDCDC" Offset="0" />
            <GradientStop Color="#FFF2F2F2" Offset="0.5" />
            <GradientStop Color="White" Offset="1" />
        </LinearGradientBrush>
    </UserControl.Background>
    <!--<i:Interaction.Triggers>
        <i:EventTrigger EventName="PreviewKeyDown">
            <i:InvokeCommandAction Command="{Binding CloseBookDetailsCommand}" CommandParameter="{Binding SelectedBook}" />
        </i:EventTrigger>
    </i:Interaction.Triggers>-->

    <Border Name="brdMain" BorderThickness="2,0,1.5,2" CornerRadius="8">
        <Border.BorderBrush>
            <LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5">
                <GradientStop Color="Gray" Offset="0" />
                <GradientStop Color="White" Offset="1" />
            </LinearGradientBrush>
        </Border.BorderBrush>

        <Grid Name="MainLayout" Margin="10,5">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition />
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition />
            </Grid.ColumnDefinitions>

            <Rectangle Grid.ColumnSpan="2" Margin="-5,2" Height="2">
                <Rectangle.Fill>
                    <LinearGradientBrush StartPoint="0,0.5" EndPoint="1,0.5">
                        <GradientStop Color="Black" Offset="0" />
                        <GradientStop Color="White" Offset="1" />
                    </LinearGradientBrush>
                </Rectangle.Fill>
            </Rectangle>
            <Button Name="btnCloseBookDetails" Grid.Row="1" Grid.Column="1" Margin="5,5" 
                    HorizontalAlignment="Right" VerticalAlignment="Top" Panel.ZIndex="9999"
                    Width="{Binding RelativeSource={x:Static RelativeSource.Self}, Path=ActualHeight}" 
                    FontFamily="Arial" FontWeight="Bold" Foreground="White" Background="Red" Content="x" 
                    Command="{Binding CloseBookDetailsCommand}" CommandParameter="{Binding SelectedBook}" />
            <StackPanel Grid.Row="1" Grid.ColumnSpan="2" Orientation="Vertical">
                <TextBlock Name="txtbTitle" Margin="0,0,30,0" Text="{Binding SelectedBook.Title, FallbackValue=TITLE}" FontWeight="Bold" FontFamily="Arial" FontSize="32" />
                <Rectangle Margin="0,2" Height="0.5">
                    <Rectangle.Fill>
                        <LinearGradientBrush StartPoint="0,0.5" EndPoint="1,0.5">
                            <GradientStop Color="Gray" Offset="0" />
                            <GradientStop Color="White" Offset="1" />
                        </LinearGradientBrush>
                    </Rectangle.Fill>
                </Rectangle>
            </StackPanel>
            <Image Name="imgBookCover" Grid.Row="2" VerticalAlignment="Center" Height="200" Width="150"
                   Source="/BookManager;component/Images/bookmgr_stacked_jeans.png" Stretch="Uniform" />

            <ItemsControl Grid.Row="2" Grid.Column="1" VerticalAlignment="Top" Height="25" Panel.ZIndex="9999">
                <ScrollBarVisibility />
                <ItemsControl.Background>
                    <LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5">
                        <GradientStop Color="#FFEBEBEB" Offset="0" />
                        <GradientStop Color="White" Offset="1" />
                    </LinearGradientBrush>
                </ItemsControl.Background>
                <ItemsControl.ItemTemplate>
                    <DataTemplate>
                        <Label HorizontalAlignment="Left">
                            <Hyperlink>
                                <TextBlock Text="General" Foreground="Gray" FontStyle="Normal" FontWeight="Bold" FontFamily="Arial Rounded MT" />
                            </Hyperlink>
                        </Label>
                    </DataTemplate>
                </ItemsControl.ItemTemplate>
            </ItemsControl>
            <TabControl Name="tbctrlBookDetails" Grid.Row="2" Grid.Column="1" Grid.RowSpan="2" Margin="0,18" Background="Transparent">
                <TabItem Name="tabBookGeneral" Header="General">
                    <TabItem.HeaderTemplate>
                        <DataTemplate>

                        </DataTemplate>
                    </TabItem.HeaderTemplate>

                    <Grid Name="grdBookGeneral" Grid.ColumnSpan="2">
                        <Grid.RowDefinitions>
                            <RowDefinition />
                            <RowDefinition />
                            <RowDefinition />
                            <RowDefinition />
                            <RowDefinition />
                            <RowDefinition />
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="150" />
                            <ColumnDefinition />
                        </Grid.ColumnDefinitions>
                    </Grid>
                </TabItem>
                <TabItem Name="tabBookPersonal" Header="Personal">
                    <TabItem.HeaderTemplate>
                        <DataTemplate>

                        </DataTemplate>
                    </TabItem.HeaderTemplate>

                    <Grid Name="grdBookPersonal" Grid.ColumnSpan="2">
                        <Grid.RowDefinitions>
                            <RowDefinition />
                            <RowDefinition />
                            <RowDefinition />
                            <RowDefinition />
                            <RowDefinition />
                            <RowDefinition />
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="150" />
                            <ColumnDefinition />
                        </Grid.ColumnDefinitions>
                    </Grid>
                </TabItem>
            </TabControl>
        </Grid>
    </Border>
</UserControl>
